<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateGoodsTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title', 191)->nullable()->comment("名称");
            $table->string('abstract', 191)->nullable()->comment("简介");
            $table->text('pic');
            $table->float('length')->default(0)->comment("长");
            $table->float('wide')->default(0)->comment("宽");
            $table->integer('category_id')->default(null)->comment("分类id");
            $table->decimal('price', 10, 2)->default(0)->comment("价格");
            $table->float('gram_weight')->default(0)->comment("克重");
            $table->text('describe')->nullable()->comment("描述");
            $table->integer('read_num')->default(0)->comment("阅读量");
            $table->integer('like_num')->default(0)->comment("点赞数");
            $table->integer('on_sell')->default(1)->comment("是否上架");
            $table->integer('sort')->default(0)->comment("排序值");
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('goods');
    }
}
